#include "info.h"
#include "re.h"
#include "utils.h"

void about_m(INFO *info) {

   RE *re;
   char *buffer[5];

   re = (RE *) malloc(sizeof(RE));

   if(matcher("^:([^ ]+)!([^ ]+)@[^ ]+ PRIVMSG ([^ ]+) :\\.about (.*)$", info->reciev, re)) {

      buffer[0] = re_copy(re,1, info->reciev);
      buffer[1] = re_copy(re,3, info->reciev);
      buffer[2] = re_copy(re,4, info->reciev);

      strtolower(buffer[1]);
      if(strcmp(buffer[2],"version")==0)
        // if(strchr(buffer[1], '#')==NULL)
         //   ssock(info->fd, "PRIVMSG %s :%s, OneBot v0.1\r\n", buffer[0], buffer[0]);
       //  else
            ssock(info->fd, "PRIVMSG %s :%s, OneBot v0.1\r\n", buffer[1], buffer[0]);

   }               

}

void onebot_m(INFO *info) {

   about_m(info);

}
